const express = require('express');
const userInfo_handler = require('..//router_handler/userInfo')

const expressJoi = require('@escook/express-joi')

//注册路由
const router = express.Router();

//验证对象
const {updataUserInfo_schema,updatapwd_schema,updataavatar_schema} = require('../sechema/user')

//路由
//获取用户信息
router.get("/userinfo",userInfo_handler.getUserInfo);

//更改用户信息
router.post("/userinfo",expressJoi(updataUserInfo_schema),userInfo_handler.updataUserInfo);

//更改密码
router.post("/updatepwd",expressJoi(updatapwd_schema),userInfo_handler.updatapwd)

//更换头像
router.post("/update/avatar",expressJoi(updataavatar_schema),userInfo_handler.updataAvatar)

module.exports = router